import React, { memo, useState } from "react";
import { View } from "@tarojs/components";
import { Barcode, QRCode } from "taro3-code";
// https://www.npmjs.com/package/taro3-code
// yarn add taro3-code
const index = memo(() => {
  const [oneCode, setOneCode] = useState("hollow");
  const [twoCode, setTwoCode] = useState("hollow");
  return (
    <View>
      一维码
      <Barcode text={oneCode} width={300} height={60} scale={4} />
      二维码
      <QRCode
        text={twoCode}
        size={300}
        scale={4}
        errorCorrectLevel="M"
        typeNumber={2}
      />
    </View>
  );
});

export default index;
